﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Drawing.Imaging;

public partial class OutputStream_1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.ClearContent();
        Response.ContentType = "image/png";
        
        Bitmap b = new Bitmap(200, 200);
        Graphics g = Graphics.FromImage(b);
        g.DrawLine(new Pen(Color.Red), 0, 0, 200, 200);
        b.Save(Response.OutputStream, ImageFormat.Gif);

        b.Dispose();
        g.Dispose();
    }
}
